home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / batchfactory / scripts / adpro / adpro_iff_frames_to_anim5 < prev    next >
Encoding:
Text File  |  1995-01-12  |  3.7 KB  |  147 lines

  1. /* 
  2.                          ADPRO IFF FRAMES TO ANIM
  3.                                By J.L. White
  4.                           ©1994 Merlin's Software
  5.  
  6.                         Convert IFF Frames To Anim5
  7.                          Art Department Pro Script
  8.  
  9.  Batch Factory Batch Conversion Scripts are basically Arexx scripts that
  10. allow you to pass certain parameters to the external program you wish
  11. to use to convert the images from one format to another. You can pass
  12. five different strings from Batch Factory to the script by using the
  13. following commands:
  14.  
  15. $N = This will pass the current selected filename.
  16. $P = This will tell Batch Factory to ask for a path to save new frames to.
  17. $# = This will pass the current frame number in the script.
  18. $T = This will pass the total number of frames in the script.
  19. $A = This will pass an offset number to be used to save frames with.
  20.  
  21. NOTE: The following line is required to work as a Batch Factory Script:
  22.  
  23. PARSE=$N $# $T
  24.  
  25. */
  26.  
  27. options results
  28. call Locate_ADPro
  29.  
  30. address "ADPro"
  31. arg TheFile FrameNum TotalFiles
  32.  
  33. PAR = '22'X
  34.  
  35. if FrameNum = 1 then do
  36.     adpro_to_front
  37.     Getfile '"Enter Name For Animation!"'    
  38.     if RC ~= 0 then do
  39.                 adpro_to_front
  40.         okay1 "I Need a Name To Work Correctly!"
  41.         adpro_to_back
  42.         pause 100
  43.                 exit
  44.     end
  45.     NAME = ADPRO_RESULT
  46.     Path = GetPathName(NAME)
  47.     Pic = GetFileName(NAME)
  48.     if Path = "RAM DISK:" then do
  49.         NAME = "RAM:"Pic
  50.         end
  51.     pstatus Unlocked
  52.     RList = '"0" "2" "4" "8" "16" "32" "64" "128" "256" "EHB" "HAM" "HAM8                 "'
  53.     Listview '"Choose Render Mode"' 8 '"Load"' ITEMS RList
  54.     parse var adpro_result Colors Blah
  55.     Colors = strip(Colors,'B',PAR)
  56.  
  57.     RList = '" " "0 - Off" "1 - Floyd" "2 - Burkes" "3 - Sierra" "4 - Jarvis" "5 - Stucki" "6 - Random" "7 - Large Order" "8 - Small Order      " '
  58.     Listview '"Choose Dither Mode"' 9 '"Load"' ITEMS RList
  59.     parse var adpro_result MyDither"-"Blah
  60.     MyDither = strip(MyDither,'B',PAR)
  61.  
  62.     call open TempFile,"Ram:AIFTA",W
  63.     call writeln TempFile,NAME
  64.     call writeln TempFile,Colors
  65.     call writeln TempFile,MyDither
  66.     call close TempFile
  67.     end
  68. else do
  69.     call open TempFile,"Ram:AIFTA",R
  70.     line = readln(TempFile)
  71.     parse var line NAME
  72.     line = readln(TempFile)
  73.     parse var line Colors
  74.     line = readln(TempFile)
  75.     parse var line MyDither
  76.     call close TempFile
  77.     end
  78. if FrameNum = TotalFiles then 
  79.     address command "delete >NIL: Ram:AIFTA"
  80. lformat "UNIVERSAL"
  81. load TheFile
  82. if RC ~= 0 then do
  83.    adpro_to_front
  84.    okay1 "Error Loading" TheFile
  85.    adpro_to_back
  86.    pause 100    
  87.    exit
  88. end
  89. if FrameNum =1 then pstatus Locked
  90. call Set_Screen
  91.  
  92. execute
  93. sformat "ANIM"
  94. if FrameNum = TotalFiles then 
  95.     save NAME "SCREEN" WRAPUP
  96. else
  97.     save NAME "SCREEN" APPEND
  98. if RC ~= 0 then do
  99.    adpro_to_front
  100.    okay1 "Error Saving" NAME
  101.    adpro_to_back
  102.    pause 100
  103.    exit
  104.    end
  105. exit
  106.  
  107. Locate_ADPro:
  108.     if (POS('ADPro',SHOW('Ports')) = 0)
  109.     then do
  110.         address command 'run < nil: > nil: adpro:adpro MAXMEM=5000000'
  111.         address command 'wait 4'
  112.     end
  113. return
  114.  
  115.  
  116. Set_Screen:
  117.     Render_Type Colors
  118.     Dither MyDither
  119.     XSIZE
  120.     X = adpro_result
  121.     YSIZE
  122.     Y = adpro_result
  123.     SType = 0
  124.     if X > 376 then SType = SType + 1
  125.     if X > 350 & X < 640 then SType = SType + 8
  126.     if X > 640 then SType = SType + 8
  127.     if Y > 256 then SType = SType + 2
  128.     if Y = 256 | Y = 512 then SType = SType + 4
  129.     if Y > 200 & Y < 400 & Y ~= 256 then SType = SType + 16
  130.     if Y > 400 & Y < 512 then SType = SType + 16
  131.     if Y > 512 then SType = SType + 16
  132.     Screen_Type SType
  133. return
  134.  
  135.  
  136. GetFileName: procedure  
  137.    ARG CompleteName
  138.    c = lastpos("/",CompleteName)
  139.    if c = 0 then c = lastpos(":",CompleteName)
  140.    return substr(CompleteName, c + 1)
  141.  
  142. GetPathName: procedure  
  143.    ARG CompleteName
  144.    c = lastpos("/",CompleteName)
  145.    if c = 0 then c = lastpos(":",CompleteName)
  146.    return left(CompleteName,c)
  147.